<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=7" />
<title>添加</title>
<script type="text/javascript">
	//图片上传的初始化
	$('#uploadify').uploadify({
		'uploader' : 'uploadify/scripts/uploadify.swf',
		'script' : 'picUploadify', //指定服务端处理类的入口
		'folder' : 'upload/image',
		'cancelImg' : 'uploadify/cancel.png',
		'fileDataName' : 'uploadify', //和input的name属性值保持一致就好，Struts2就能处理了   
		'queueID' : 'fileQueue',
		'auto' : true,//是否选取文件后自动上传   
		'multi' : false,//是否支持多文件上传
		'simUploadLimit' : 1,//每次最大上传文件数   
		'fileDesc' : '.jpg文件或.gif文件或.png文件',//上传文件类型说明
		'fileExt' : '*.jpg;*.gif;*.png',
		'wmode' : 'transparent', //隐藏进度条
		'displayData' : 'percentage',//有speed和percentage两种，一个显示速度，一个显示完成百分比    
		'onComplete' : function(event, queueID, fileObj, response, data) {
			$("#picPath").val(response);
			$("#imgpath").html("<img src='"+response+"' />");
		}
	});

	//DWZ验证图片的TEXT框是否为空
	function validateAddTechCooper(obj, navTabAjaxDone) {
		var flag = false;
		var picId_b = $("#picPath").val();
		if (picId_b == '') {
			alertMsg.warn('图片未加载完毕或未上传，请重试');
			flag = false;
			return false;
		}
		if (validateCallback(obj, navTabAjaxDone)) {
			flag = true;
		}
		return flag;
	}
</script>
</head>
<body>
	<div class="pageContent">
		<form class="pageForm required-validate" method="post" action="addAppPicAction.action" onsubmit="return validateAddTechCooper(this, navTabAjaxDone);">
			<input type="hidden" name="rightId" value="${rightId}" />
			<div class="pageFormContent" layoutH="56">
				<table>
					<tr>
						<td>用处描述：</td>
						<td><select class="" name="picDesc" style="width: 193px">
									<option value="快递公司">快递公司</option>
									<option value="首页" selected="selected">首页</option>
								</select>
						</td>
						</tr>
					<tr>
					<tr>
						<td>图片关联路径：</td>
						<td>
						<input name="url" type="text" size="30" class="required textInput valid"/>
						</td>
						</tr>
					<tr>	
					<tr>
						<td>图片名称：</td>
						<td>
						<input name="picName" type="text" size="30" class="required textInput valid"/>
						</td>
						</tr>
					<tr>	
						<td>图片：</td>
						<td><input type="file" name="uploadify" id="uploadify" /> <input id="picPath" type="hidden" name="picAddress" />(不能为空)
					</tr>
					<tr>
						<td colspan="2">
							<div id="imgpath"></div>
						</td>
					</tr>
					
					<tr>
					<td>排序顺序：</td>
						<td>
						<input name="displaySequence" onkeyup="value=value.replace(/[^\d.]/g,'')" type="text" size="30" class="required textInput valid"/>
						</td>
						</tr>
					<tr>	
				</table>
			</div>
			<div class="formBar">
				<ul>
					<li>
						<div class="buttonActive">
							<div class="buttonContent">
								<button type="submit">保存</button>
							</div>
						</div>
					</li>
					<li>
						<div class="button">
							<div class="buttonContent">
								<button type="button" class="close">取消</button>
							</div>
						</div>
					</li>
				</ul>
			</div>
		</form>
	</div>
</body>
</html>